package 公司真题.去哪网;

import java.util.*;

public class _数字加密 {
    static List<String> getAll(int length, int start, int end, String input) {
        // 回溯
        char[] arr = input.substring(start, end).toCharArray();
//        System.out.println(new String(arr));
        String pre = input.substring(0, start);
        String post = end == length ? null : input.substring(end, length);
        List<String> sub = new ArrayList<>();
        backTrack(arr, sub, 0, new char[arr.length]);
        Set<String> set = new HashSet<>();
        for (String subString : sub) {
            set.add(subString);
        }
        System.out.println("============");
        System.out.println(sub.size());
        System.out.println(sub);
        System.out.println("============");
        System.out.println(set.size());
        System.out.println(set);
        System.out.println("============");
        List<String> res = new ArrayList<>();
        for (String subString : set) {
            res.add(pre + subString + post);
        }
        return res;
    }

    private static void backTrack(char[] arr, List<String> sub, int begin, char[] temp) {
        if (begin == arr.length) {
            sub.add(new String(arr));
            return;
        }
        temp = new String(arr).toCharArray();
        for (int i = 0; i < arr.length; i++) {
            sub.add(new String(arr));
            temp[begin] = (char) (temp[begin] - 32);
            sub.add(new String(arr));
            backTrack(temp, sub, begin + 1, new char[temp.length]);
            temp[begin] = (char) (temp[begin] + 32);
            sub.add(new String(arr));
        }
    }

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String line = in.nextLine().trim();

        int endIndexOfLength = line.indexOf(' ');
        int length = Integer.parseInt(line.substring(0, endIndexOfLength));

        int endIndexOfStart = line.indexOf(' ', endIndexOfLength + 1);
        int start = Integer.parseInt(line.substring(endIndexOfLength + 1, endIndexOfStart));

        int endIndexOfEnd = line.indexOf(' ', endIndexOfStart + 1);
        int end = Integer.parseInt(line.substring(endIndexOfStart + 1, endIndexOfEnd));

        String input = line.substring(endIndexOfEnd + 1);

        List<String> result = getAll(length, start, end, input);
        Collections.sort(result);
        for (int i = 0; i < result.size(); ++i) {
            if (i == result.size() - 1) {
                System.out.print(result.get(i));
            } else {
                System.out.println(result.get(i));
            }
        }
        System.out.flush();
    }
}
